<?php
/**
 * Seller.php
 *
 * @copyright  2023 opencart.cn - All Rights Reserved
 * @link       http://www.guangdawangluo.com
 * @author     TL <mengwb@opencart.cn>
 * @created    2023-05-16 19:26:22
 * @modified   2023-05-16 19:26:22
 */

namespace Beike\Seller\Models;

use Beike\Models\RegionZone;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;

class SellerShipping extends Base
{
    use HasFactory;

    protected $fillable = ['seller_id', 'region_id', 'type', 'method', 'flat', 'rules', 'priority', 'status'];

    public function seller(): BelongsTo
    {
        return $this->belongsTo(Seller::class, 'seller_id');
    }

    public function regionZones(): HasMany
    {
        return $this->hasMany(RegionZone::class, 'region_id', 'region_id');
    }
}
